home *** CD-ROM | disk | FTP | other *** search
/ Turn the Power On! 3 / Turn the Power On! HP Volume III (HP)(1995).ISO / poweron-iii < prev    next >
Text File  |  1995-10-03  |  3KB  |  163 lines

  1. #!/bin/ksh
  2.  
  3. # @(#) Version 3.0 August 1995
  4. #    Updated 22-Sep-95 for MPower Detection & Notification (WSG)
  5. set +u 
  6. arg0=$0
  7. PWD=`pwd`
  8. umask a=rwx
  9.  
  10. #
  11. # Check to see if MPower is installed
  12. #
  13.  
  14. MPOWER_CHECK_FILE="/usr/video/bin"
  15.  
  16. if [[ -a $MPOWER_CHECK_FILE ]]    # file (or dir) doesn't have non-zero length
  17. then
  18.     # file exists
  19.     MPOWER_FOUND=".T."
  20. else
  21.     # file doesn't exist
  22.     MPOWER_FOUND=".F."
  23. fi
  24.  
  25. if [ $MPOWER_FOUND = ".F." ]
  26. then
  27.     /usr/bin/X11/xdialog -geometry -1+0 -O "Click to Exit" -t "MPower Not Found" -p HPlogo.bm -m  \
  28. "Turn the Power ON! needs to have
  29. MPower installed in order to operate
  30. properly.  Please have your System
  31. Administrator run the MPower audio
  32. and video driver installation script
  33. found in the 'install_these' directory." &
  34.  
  35. exit 1
  36.  
  37. fi
  38.  
  39.  
  40.  
  41.  
  42.  
  43. DIR=`dirname $arg0`
  44. BASE=PowerON-II
  45.  
  46. if [ $DIR = "." ]
  47. then
  48.     PATH_NAME=${PWD}/lib/${BASE}/
  49. else
  50.     PATH_NAME=${DIR}/lib/${BASE}/
  51. fi
  52.  
  53. LANGU=${LANG:=american}
  54. case ${LANGU} in
  55.     american ) ;;
  56.     japanese ) ;;
  57.     japanese.euc ) LANGU=japanese ;;
  58.     katakana ) LANGU=japanese ;;
  59.     chinese-t ) ;;
  60.     chinese-s ) LANGU=chinese-t ;;
  61.     korean ) ;;
  62.     * ) LANGU=american ;;
  63. esac
  64.  
  65. if [ ! -d $PATH_NAME${LANGU} ]
  66. then
  67.     LANGU=american
  68.     echo "The requested language was not found ! Proceeding in English."
  69. fi
  70.  
  71. echo @DEMO_HOME > /tmp/poweronii_vars
  72. echo  ${PATH_NAME} >> /tmp/poweronii_vars
  73. echo @LANGUAGE >> /tmp/poweronii_vars
  74. echo  ${LANGU}/ >> /tmp/poweronii_vars
  75. #
  76. # Set the working directory for the Mpresent program.
  77. #
  78. AIMTECH=${PATH_NAME}../../bin
  79. #
  80. #  Set the Variable File to load
  81. #
  82. AIM_VAR=${PATH_NAME}
  83. #
  84. # Export the variables
  85. #
  86. export AIMTECH AIM_VAR
  87. export DEMO_HOME=${PATH_NAME}
  88. #
  89. #
  90. MP=${PATH_NAME}../../bin/Mpresent
  91. export SHLIB_PATH=${PATH_NAME}../../lib/misc
  92. if [ -x /usr/audio/bin/send_sound ]
  93.    then
  94.       export SendAudio=/usr/audio/bin/send_sound
  95.    elif [ -x /usr/audio/bin/acontrol ]
  96.    then
  97.       export SendAudio=${PATH_NAME}../../bin/send_sound
  98. fi
  99.  
  100. cd ${PATH_NAME}
  101.  
  102. #../../bin/ilcolors 0 &
  103. #IL_PID=$!
  104. #sleep 1
  105. #kill -0 $IL_PID 2>/dev/null
  106. #IL_STAT=$?
  107. #if [ 0 -ne ${IL_STAT} ]
  108. #    then
  109. #        /usr/bin/X11/xdialog -t "PowerON II" -p HPlogo.bm -m  \
  110. #"  There are not enough colors 
  111. #   available for this demo to run
  112. #   correctly.  Please stop some
  113. #   applications and try again." 
  114. #        exit 1
  115. #fi
  116.  
  117. aserver=`ps -e|grep Aserver`
  118. if [  ! "$aserver" ]
  119.     then
  120.         /usr/bin/X11/xdialog -t "Audio Server" -p HPlogo.bm -m  \
  121. "  The audio server does not 
  122.    appear to be running.  You
  123.    will not be able to hear
  124.    any sounds."
  125. fi
  126.  
  127. trap " kill $IL_PID ; ../../bin/kfork drive_server ; rm -f /tmp/poweron_vars /tmp/windows.dbf ; exit " 2 3 15
  128.  
  129. /usr/bin/X11/xdialog -t "PowerON II" -p HPlogo.bm -m  \
  130. "  
  131. Welcome to Turn the PowerON II
  132.  
  133.  Loading the Demo from disk.
  134.  
  135.         Please wait" &
  136. XWD_PID=$!
  137. #cover/cache.ksh
  138.  
  139. PATH=$PATH:.
  140. DISPLAY=${DISPLAY:=local:0}
  141. export SB_710_VM_DB=TRUE
  142. #export AIM_VAR=$PATH_NAME
  143.  
  144. if [ -x /usr/audio/bin/AudioCP ]
  145.    then
  146.       /usr/audio/bin/AudioCP -geometry +0-1&
  147.    elif [ -x /usr/audio/bin/acontrol ]
  148.       then
  149.          /usr/audio/bin/acontrol -geometry +0-1&
  150. fi
  151. ACP=$!
  152. kill $XWD_PID 2>/dev/null
  153. $MP ${PATH_NAME}PowerON_New.iw
  154. #$MP ${PATH_NAME}test.iw
  155.  
  156. kill $IL_PID 2>/dev/null
  157. kill $ACP
  158. ../../bin/kfork drive_server
  159. ../../bin/kfork send_sound
  160. ../../bin/kfork mplay
  161. ../../bin/kfork cover.ksh
  162. rm -f /tmp/poweron_vars /tmp/windows.dbf
  163.